import asyncio
import aiomysql

async def db_op(label):

    print(label)
    conn = await aiomysql.connect(host='127.0.0.1',
                                  port=3306, user='root', password='root', db='macau')

    print(label)
    cur = await conn.cursor()

    print(label)
    await cur.execute("select * from city")

    print(label)
    result = await cur.fetchall()

    print(label)
    print(result)

    print(label)
    await cur.close()
    conn.close()

#asyncio.run(db_op())
tasks = [db_op(1111),db_op(2222)]
asyncio.run(asyncio.wait(tasks))
